package com.hkts.naturalgas.datahandler.dataenum;

/**
 * @ClassNameFucntionEnum
 * @Description
 * @Author yck
 * @Date2021-10-28 16:05
 * @Version V1.0
 **/
public enum FucntionEnum {
    SIN("sin",0), COS("cos", 1), COEFFICIENT("coefficient", 2), RANDOM("random", 3);
    private String name;
    private int index;
    private FucntionEnum(String name, int index) {
        this.name = name;
        this.index = index;
    }
    public static String getName(int index) {
        for (FucntionEnum c : FucntionEnum.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }
    // get set 方法
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getIndex() {
        return index;
    }
    public void setIndex(int index) {
        this.index = index;
    }
}
